Skip to content

Use CLOCK_BOOTTIME also for amd64's time.now() in Go runtime #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

mateusz-markowicz
Copy link

This change was missing in the original patch causing issues with GoLang time functions on chromebooks after device wakes up from sleep and leading to failed connections.

After running below code on Chromebook after it was sleeping since boot

timestamp := time.Now()
elapsed := time.Since(timestamp)

elapsed will have a difference between CLOCK_MONOTONIC and CLOCK_BOOTTIME which is the time device was sleeping since boot. It should be reproducible on any device with arm64 and where CLOCK_MONOTONIC and CLOCK_BOOTTIME can give different values. This behavior leads to incorrectly testing expiry for keypairs and consequently failed connections.

Issue seems to be reported here:
https://www.reddit.com/r/chromeos/comments/r2t1x4/chromeos_update_breaks_wireguard_android_vpn_apps/

zx2c4 and others added 2 commits October 22, 2023 02:35
Signed-off-by: Jason A. Donenfeld <[email protected]>
This change was missing in the original patch causing issues with
GoLang time functions on chromebooks after device wakes up from sleep
and leading to failed connections.

Signed-off-by: Mateusz Markowicz <[email protected]>
@mateusz-markowicz
Copy link
Author

@zx2c4 you guys might find this interesting, without it wireguard-android is pretty much unusable on x86_64 (on chromebooks)

@zx2c4-bot zx2c4-bot force-pushed the master branch 3 times, most recently from 91cdc96 to 57bd0ec Compare May 5, 2025 14:20
@zx2c4
Copy link
Member

zx2c4 commented May 6, 2025

I think we're already doing this in the latest upstream master. (I'll make an app release soon.)

@zx2c4 zx2c4 closed this May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants